/**
 * 
 */
package com.baijia.jigou.principal;

import com.baijia.authentication.Authentication;
import com.baijia.authentication.AuthenticationMetaDataPopulator;
import com.baijia.authentication.principal.Credentials;
import com.baijia.jigou.util.WebContext;
import com.baijia.jigou.util.WebContext.WebSession;


/**
 * @title JigouAccountMetaDataPopulator
 * @desc TODO 
 * @author caoliang
 * @date 2015年11月12日
 * @version 1.0
 */
public final class CookieJigouAccountMetaDataPopulator implements AuthenticationMetaDataPopulator{
    
	@Override
	public Authentication populateAttributes(Authentication authentication,
			Credentials credentials) {
        WebSession webSession =  WebContext.getSession();
        authentication.getAttributes().put(ACCOUNT_ID, webSession.getLoginAccount().getId());
        authentication.getAttributes().put(ACCOUNT_NUMBER, webSession.getLoginAccount().getNumber());
		return authentication;
	}

    @Override
    public boolean supports(Credentials credentials) {
        
        // TODO Auto-generated method stub
        return false;
            
    }

}
